// #ifdef H5
import { getUrlParams } from '@/utils/utils';
// 获取H5下的代理环境参数
const proxy = getUrlParams();
// #endif

// 默认城市code
export const cityCode = '350100'

// 各个环境下的请求地址
export const baseUrls = {
  test: 'https://tkzc-release-napi.zmaxfilm.com/api', // 测试环境
  release: 'https://ilike-cloud-mapi.zmaxfilm.com/api', // 微信正式环境
  production: 'https://tkzc-release-napi.zmaxfilm.com/api', // 正式环境
  develop: 'https://tkzc-release-napi.zmaxfilm.com/api', // 微信开发环境
  trial: 'https://tkzc-release-napi.zmaxfilm.com/api', // 微信体验环境
  // #ifndef H5
  development: 'https://tkzc-release-napi.zmaxfilm.com/api' // 开发环境
  // #endif
  // #ifdef H5
  development: proxy.env ? `${proxy.env}/api` : '/dev/api' // 开发环境
  // #endif
};
// 用于渠道在选座页时跳转联登和支付
export const askUrl = "https://activity-oss.zmaxfilm.com/bank/out-request/index.html#/"
// 第三方支付相关的地址
const payUrls = {
  develop: {
    toBackUrl: 'https://tkzc-release-cwap.zmaxfilm.com/webviewback.html', // 支付完成后返回的地址
    toPayWeb: 'https://tkzc-release-cwap.zmaxfilm.com/webview.html', // 支付中转页面负责提交支付表单后重定向跳转
    outPayLink:'http://pre-ilike-activity.zmaxfilm.com/XF-Act1/NewPaySuccess'
  },
  trial:{
    toBackUrl: 'https://tkzc-release-cwap.zmaxfilm.com/webviewback.html', // 支付完成后返回的地址
    toPayWeb: 'https://tkzc-release-cwap.zmaxfilm.com/webview.html', // 支付中转页面负责提交支付表单后重定向跳转
    outPayLink:'http://pre-ilike-activity.zmaxfilm.com/XF-Act1/NewPaySuccess'
  },
  production: {
    toBackUrl: 'https://ilike-cloud-wap.zmaxfilm.com/webviewback.html',
    toPayWeb: 'https://ilike-cloud-wap.zmaxfilm.com/webview.html',
    outPayLink:'https://activity.zmaxfilm.com/bank/XF-Act1/NewPaySuccess'
  },
  release:{
    toBackUrl: 'https://ilike-cloud-wap.zmaxfilm.com/webviewback.html',
    toPayWeb: 'https://ilike-cloud-wap.zmaxfilm.com/webview.html',
    outPayLink:'https://activity.zmaxfilm.com/bank/XF-Act1/NewPaySuccess'
  }
}
// 开发环境和生产环境判断
let env = null;
// #ifdef MP-WEIXIN
env = uni.getAccountInfoSync().miniProgram.envVersion; // 获取微信运行环境
// #endif
// #ifndef MP-WEIXIN
env = process.env.NODE_ENV; // 获取除了微信以外的运行环境
// #endif
export const baseImageUrl = 'https://public-oss-file.zmaxfilm.com'; // 图片地址
export const baseUrl = uni.getStorageSync('baseUrl') || baseUrls[env];
export const payUrl = payUrls[env];
export const umaKey = '5fe05377345b8b53f574eb68'; // 友盟统计的key

// 地图密钥，腾讯地图
export const mapSecret = 'PXMBZ-273RG-YUMQW-QQHO7-M2DFJ-G7FYJ'

export default {
  baseUrl,
  baseUrls,
  mapSecret,
  payUrl,
  askUrl
};
